package com.showcase.cloud.gateway.feign;

import com.sun.showcase.client.domain.basic.ResourceInfo;
import com.sun.showcase.client.domain.basic.UserInfo;
import com.sun.showcase.pojo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "${service.basic.name}",path = "${service.basic.path}",fallback = UserFeignFallbackService.class)
public interface UserFeignService {
    @RequestMapping(value="/basic/userInfo/loadUserByUsername",method = RequestMethod.GET)
    public Result<UserInfo> loadUserByUsername(@RequestParam("userName") String userName);
    @RequestMapping(value="/basic/userInfo/allPermissions",method = RequestMethod.GET)
    public Result<List<ResourceInfo>> allPermissions(@RequestParam("userId") String userId);
}